<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <style>
        html, body {
            background-color: #f8f8f8;
        }
        .main {
        	margin: 24px 0;
        	position: relative;
        }
        .main ul li {
        	margin-bottom: 9px;
        }
        .main ul li:last-child {
        	margin-bottom: 0;
        }
        .li_box {
        	display: -webkit-box;
        	display: -webkit-flex;
        	align-items: center;
			padding: 0 15px;
        }
        .li_box .li_boxl {
        	padding-right: 15px;
        }
        .li_box .li_boxl .num {
        	width: 16px;
        	height: 16px;
        	line-height: 16px;
        	text-align: center;
        	font-size: 12px;
        	border-radius: 50%;
        	color: #fff;
        	background-color: #e62442;
        	display: block;
        	position: relative;
        	z-index: 100;
        }
        .li_box .li_boxc .triangle_left {
		    width: 0;
		    height: 0;
		    border-top: 6px solid transparent;
		    border-right: 12px solid #fff;
		    border-bottom: 6px solid transparent;
		}
        .li_box .li_boxr {
        	flex: 1;
        	-webkit-flex: 1;
        	box-flex: 1;
        	-webkit-box-flex: 1;
        }
        .li_box .li_boxr .info {
        	padding: 12px 10px;
        	background-color: #fff;
        }
        .li_box .li_boxr .info .info_p {
        	font-size: 15px;
        	color: #333;
        }
        .li_box .li_boxr .info .info_p_s {
        	color: #e62442;
        }
        .li_box .li_boxr .info .info_time {
        	margin-bottom: 5px;
        	font-size: 12px;
        	color: #999;
        }
        .li_box .li_boxr .info .info_reason {
        	color: #333;
        	font-size: 12px;
        	margin-top: 10px;
        }
        .li_box .li_boxr .info .info_reason span {
        	color: #999;
        }
        .li_box .li_boxr .info .info_tips {
        	color: #e62442;
        	font-size: 12px;
        	margin-top: 10px;
        }
        .line {
        	width: 1px;
        	background-color: #e62442;
        	position: absolute;
        	left: 23px;
        	z-index: 99;
        }
    </style>
</head>
<body>
    <div class="main">
    	<ul id="data_ul">

 <!--    		<li>
    			<div class="li_box">
    				<div class="li_boxl">
    					<span class="num">2</span>
    				</div>
    				<div class="li_boxc">
    					<div class="triangle_left"></div>
    				</div>
    				<div class="li_boxr">
    					<div class="info">
    						<p class="info_p">等待商家审核</p>
    						<p class="info_time">2017-09-08 12:42:14</p>
    					</div>
    				</div>
    			</div>
    		</li>
    		<li>
    			<div class="li_box">
    				<div class="li_boxl">
    					<span class="num">3</span>
    				</div>
    				<div class="li_boxc">
    					<div class="triangle_left"></div>
    				</div>
    				<div class="li_boxr">
    					<div class="info">
    						<p class="info_p">商家不同意退款</p>
    						<p class="info_time">2017-09-08 12:42:14</p>
    						<div class="info_reason">理由：<span>外卖已送出</span></div>
    					</div>
    				</div>
    			</div>
    		</li>
    		<li>
    			<div class="li_box">
    				<div class="li_boxl">
    					<span class="num">4</span>
    				</div>
    				<div class="li_boxc">
    					<div class="triangle_left"></div>
    				</div>
    				<div class="li_boxr">
    					<div class="info">
    						<p class="info_p info_p_s">退款失败</p>
    						<p class="info_time">2017-09-08 12:42:14</p>
    					</div>
    				</div>
    			</div>
    		</li>
    		<li>
    			<div class="li_box">
    				<div class="li_boxl">
    					<span class="num">5</span>
    				</div>
    				<div class="li_boxc">
    					<div class="triangle_left"></div>
    				</div>
    				<div class="li_boxr">
    					<div class="info">
    						<p class="info_p info_p_s">商家不同意退款</p>
    						<p class="info_time">2017-09-08 12:42:14</p>
    						<div class="info_tips">退款已返回至支付该订单的账户</div>
    					</div>
    				</div>
    			</div>
    		</li> -->
    	</ul>
    	<div class="line"></div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script id="dataTpl" type="text/x-dot-template">
    {{ for(var i=0;i<it.length;i++){ }}
        <li>
            <div class="li_box">
                <div class="li_boxl">
                    <span class="num">{{=(i+1)}}</span>
                </div>
                <div class="li_boxc">
                    <div class="triangle_left"></div>
                </div>
                <div class="li_boxr">
                    <div class="info">
                        <p class="info_p {{if(it[i]['is_red'] == 1){ }}info_p_s{{ }; }}">{{=it[i]['remark']}}</p>
                        <p class="info_time">{{=it[i]['create_time']}}</p>
                        {{if(it[i]['cause']){ }}
                            <div class="info_reason">理由：<span>{{=it[i]['cause']}}</span></div>
                        {{ }; }}
                        {{ if(it[i]['tip']){ }}
                            <div class="info_tips">{{=it[i]['tip']}}</div>
                        {{ }; }}
                    </div>
                </div>
            </div>
        </li>
    {{ }; }}
</script>
<script type="text/javascript">
    apiready = function(){
        order_id = api.pageParam.order_id;


        fnGetRecord();
    };

    function fnGetRecord() {
        openLoading();
        user = $api.getStorage('user_data');
        api.ajax({
            url: rootPath+'/api/order/refund_record',
            method: 'get',
            data: {
                values: { 
                    order_id: order_id,
                    uid : user.id,
                    token : user.token,
                },

            }
        }, function(ret, err) {
            if (ret) {
                if(ret.status == 200) {
                    setDotData(ret.data,'dataTpl','data_ul',true);
                    $('.line').css({
                        'top': $('.main li:first-child').height() / 2,
                        'bottom': $('.main li:last-child').height() / 2
                    });
                }
                closeLoading();
            } else {
                api.toast({
                    msg: err.msg,
                    location : 'middle'
                });
                closeLoading();
            }
        });
    }
</script>
</html>